package com.easylinkin.linkappapi.ruleengine.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.easylinkin.linkappapi.ruleengine.entity.RuleCondition;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
import java.util.Set;

/**
 * <p>
 * 条件器 服务类
 * </p>
 *
 * @author TongJie
 * @since 2020-08-24
 */
public interface RuleConditionService extends IService<RuleCondition> {

    void add(RuleCondition ruleCondition);

    List<RuleCondition> getRuleConditions(RuleCondition ruleCondition);

    List<RuleCondition> getRuleConditionWithExpressions(RuleCondition ruleCondition);

    IPage<RuleCondition> getRuleConditions(Page page, RuleCondition ruleCondition);

    RuleCondition getRuleCondition(String id);

//    void updateRuleCondition(RuleCondition ruleCondition);

    void deleteBatch(List<RuleCondition> ruleConditionList);

    /**
     * 查找 规则引擎id 在范围中的 条件器
     */
    List<RuleCondition> getRuleConditionsInRuleEngineIds(Set<String> meetRuleTriggerRuleEngineIds);

    /**
     * 查找满足条件的器的 规则引擎id
     *
     * @param meetedRuleEngineIds 被筛选的对象：规则引擎id集合
     * @return 满足条件器条件的 规则引擎id集合
     */
    Set<String> getMeetRuleConditionRuleEngineIds(Set<String> meetedRuleEngineIds);
}
